#include "main.h"
#include "FlashOS.h" 
#include "stdio.h"
extern struct FlashDevice const FlashDevice; 
volatile int ret;          

extern void ShowString(char *str);
// Return Code 
/* Error handling function */ 
void stop_on_error(uint32_t cond) 
{ 
	if(cond) {
		//__BKPT(0x1); // Error occurred during execution 
		while(1){} 
	} 
} 

/*---------------------------------- 
Main Function 
*---------------------------------*/ 
int main(void) 
{ 
	/* Test Flash Erase operation */  
	ret = Init(FlashDevice.DevAdr, 0, 1); 
	stop_on_error (ret);  
	ret = EraseChip(); 
	stop_on_error (ret);
	ret = BlankCheck(EXFLASH_BASE,16*1024*1024,0XFF); 
	printf("Cond: %0x\n",ret);
	ret = EraseSector(0x9000000); 
	stop_on_error (ret);  
	ret = UnInit(1); 
	stop_on_error(ret); 
	
	while(1){} 
}
